<%@ page contentType="text/html; charset=UTF-8" buffer="16kb"%>
<%@ include file="../include/taglib.jsp"%>
<%
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragrma", "no-cache");
    response.setDateHeader("Expires", 0);
    Long resid = Long.parseLong(request.getParameter("id"));
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>linux综合性能页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta name="Keywords" content=" " />
<meta name="Description" content=" " />
<%@ include file="../include/common.jsp"%>

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/sub_menu.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/perf/listPage.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/charts/FusionCharts.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/charts/FusionCharts.jqueryplugin.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/common/Xslider.js"></script>
	
<script type="text/javascript">

    var iochart;
	function initLock(){
		$.ajax({
			url : 'real-time!get2LineChart.action', // 
			type : 'POST',
			dataType : "json",
			data : {
				resId :<%=resid %>,
				childType:'1202020500000',
				propIds:'120202050000001,120202050000002'
			},
			success : function(dataset) {
				if(typeof iochart == undefined || iochart==null){
					iochart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/MSSpline.swf?ChartNoDataText=没有数据","ioChart1", "100%", "150px", "0", "1" );
				}
				iochart.setJSONData(dataset);
				iochart.render("iolineChart");
			}
		});
	}
	
	
	
	var uptimeColChart;
	var fsColChart;
	var indexColChart;
	function initBaseInfo(){
			//基本信息
			$.ajax({
				url : 'real-time!getBaseInfo.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					propIds:'attr_110200000000001,prop_110202000000002,prop_110202000000004,prop_110202000000001,prop_110202000000005,prop_110200000000002,prop_110200000000001'
				},
				success : function(data) {
					$('#attr_110200000000001').text(data.attr_110200000000001); //实例名
					$('#prop_110202000000002').attr('title',data.prop_110202000000002).text(data.prop_110202000000002); 
					$('#prop_110202000000004').text(data.prop_110202000000004); 
					$('#prop_110202000000001').text(data.prop_110202000000001); //创建时间
					$('#prop_110202000000005').text(data.prop_110202000000005); //启动时间
					$('#prop_110200000000002').text(data.prop_110200000000002); //响应时间
					$('#prop_110200000000001').text(data.prop_110200000000001); //状态
					$('#resIp').text(data.ip);
				}
			});
			
			//索引空间使用大小
			if(typeof indexColChart == undefined || indexColChart == null){
				indexColChart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/Column2D.swf","indexColChart1", "100%", "130", "0", "1" );
			}
			$.ajax({
				url : 'real-time!get2ColumnChart.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					detail:1,
					childType:'1202020100000',
					propIds:'120202010000002',
					top:'15',
					unit:'MB'
				},
				success : function(data) {
					indexColChart.setJSONData(data);
					indexColChart.render("indexColChart");
				}
			});
			
			//数据库空间使用大小
			if(typeof fsColChart == undefined || fsColChart == null){
				fsColChart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/Column2D.swf","fsColChart11", "100%", "130", "0", "1" );
			}
			$.ajax({
				url : 'real-time!get2ColumnChart.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					detail:1,
					childType:'1202020100000',
					propIds:'120202010000001',
					top:'15',
					unit:'MB'
				},
				success : function(data) {
					fsColChart.setJSONData(data);
					fsColChart.render("fsColChart");
				}
			});
	}
	
	
	$(document).ready(function() {
			initBaseInfo();
			initLock();
	});
</script>

</head>
<body>

	<div class="column">
		<div class="col-main">
			<!--基本信息-->
			<div class="col-l-extra h-400">
			<h2 class="title-h2 m-0">基本信息</h2>
			<ul class="col-l-ul">
					<li><span class="col-l-ul-l" >数据库类别:</span><span 
								class="col-l-ul-r"><img src="${pageContext.request.contextPath}/style/default/bsm/perf/images/mysql24_24.png">&nbsp;&nbsp;Mysql</span>
					</li>
					<li><span class="col-l-ul-l" >主机IP:</span><span id="resIp"
							class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >实例名:</span><span id="attr_110200000000001"
								class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >安装目录:</span><span id="prop_110202000000002"
								class="col-l-ul-r col-l-ul-r-textell" style="width:70%;"></span>
					</li>			
					<li><span class="col-l-ul-l" >字符集:</span><span id="prop_110202000000004"
								class="col-l-ul-r"></span>
					</li>			
					<li><span class="col-l-ul-l" >版本信息:</span><span id="prop_110202000000001"
							class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >运行时间(s):</span><span id="prop_110202000000005"
								class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >响应时间(ms):</span><span id="prop_110200000000002"
								class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >连接状态:</span><span id="prop_110200000000001"
								class="col-l-ul-r"></span>
					</li>
			   </ul>
			</div>
			<!--@end基本信息-->
			<div class="col-r-main">
			     <div class="col-v-rate-extra" style="width:99%">
		            <h2 class="title-h2 m-0">索引空间使用 TOP15</h2>
			       <div id="indexColChart"></div>
			    </div>
			    
			     <div class="col-v-rate-extra" style="width:99%">
		            <h2 class="title-h2 m-0">数据空间使用 TOP15</h2>
			       <div id="fsColChart"></div>
			    </div>
		 </div>   
	  </div>
	</div>
	
	
	<div class="column b-1">
			<h2 class="title-h2 m-0">MySQL锁 [当天趋势图]-[立即获得表锁次数,等待获得表锁次数]</h2>
			<div class="col-net-main p-99">
			    <div id="iolineChart"></div>
		    </div>
	</div>
		
	<div class="column" style="width:100%;height:5px;"></div>
</body>